<template>
    <div class='shoppingBottom'>
        <div class='select' @click="shoppingdiv"><img src='../../assets/img/checkbox.png' v-show='istrue'></div>
        <span>全选</span>
        <span>合计:￥{{number}}</span>
        <div class='span'>去计算({{indexreduce}})</div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            istrue:null,
            // priceIndex:0
        }
    },
    props:{
        isTrues:{
            type:Boolean
            
        },
        number:{
            type:Number
        },
        shoppingindex:{
            type:Number
        }
    },
    computed:{
        indexreduce(){
            return this.shoppingindex
        }
       
    },
    watch:{
        isTrues(newName,oldName){
            this.istrue=newName;
        }
        
    },
    mounted(){
        this.istrue=this.isTrues;
       
    },
    methods:{
        // spanclick(){
           
        //     return false
        // },
        shoppingdiv(){
         
            this.istrue=!this.istrue;
            this.$emit('shoppingBottomisTrue',this.istrue)
             this.$emit('spanclick')
           
            
        }
    }
}
</script>

<style scoped>
    .shoppingBottom{
        display: flex;
        justify-content: space-between;
        background-color: #fff;
        height: 40px;
        line-height: 40px;
        position: fixed;
        bottom: 49px;
        left: 0;
        right: 0;
    }
     .shoppingBottom .span{
         width: 100px;
         background-color: #f00;
         text-align: center;
     }
    .select{
        width: 17px;
        height: 17px;
        border-radius: 50%;
        border:1px solid #000;
        margin: 11px -50px 0 10px;
        overflow: hidden;
      
    }
    .select img{
        width: 100%;
        float: left;
        vertical-align: middle;
     
    }
</style>